find_package(Qt5 COMPONENTS Widgets Network  REQUIRED)

# 设置C++标准 C++11
set(CMAKE_CXX_STANDARD 11)

# 自动把ui转化为C++代码
# uic qtcmake.ui > ui_qtcmake.h
set(CMAKE_AUTOUIC ON)

# 自动生成元对象的C++代码
set(CMAKE_AUTOMOC ON)

# 自动生成资源文件
set(CMAKE_AUTORCC ON)

add_executable(main 
            ./widget.cpp
            ./networkassistant.cpp
            ./main.cpp
            ${PROJECT_SOURCE_DIR}/src/getImage.cpp
            ${PROJECT_SOURCE_DIR}/src/receiveImage.cpp
            ${PROJECT_SOURCE_DIR}/include/receiveImage.h
            ${PROJECT_SOURCE_DIR}/include/getImage.h
            ${PROJECT_SOURCE_DIR}/include/widget.h
            ${PROJECT_SOURCE_DIR}/src/widget.ui
            ${PROJECT_SOURCE_DIR}/include/networkassistant.h
            ${PROJECT_SOURCE_DIR}/src/networkassistant.ui
)

target_link_libraries(main Qt5::Widgets Qt5::Network )

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
